<?php
namespace app\admin\controller;
use think\Controller;
use app\index\model\Comment as CommentModel;

class Comment extends Controller
{
	public function index()
	{
		$comment = new CommentModel();
		$comments = $comment->where(['status'=>['neq',-1]])->select();
		return $this->fetch('',['comments'=>$comments]);
	}

	public function screen($id)
	{
		$comment = new CommentModel();
		$res = $comment->save(['status'=>1],['id'=>$id]);
		if ($res) {
			$this->result($_SERVER['HTTP_REFERER'], 1, 'success');
		}
		$this->result($_SERVER['HTTP_REFERER'], 0, '屏蔽失败');
	}
	
}